<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <body-content><!-- 里面的内容就是插槽 -->
            <div class="header" slot="header">header</div>
            <div class="footer" slot="footer">footer</div>
        </body-content>
    </div>
    <script>
        Vue.component('body-content',{//多行字符串语法`   `
            template:`<div>
                <slot name='header'></slot>
                <div class='middle'>middle</div>
                <slot name='footer'></slot>
                </div>`
        })
        var vm=new Vue({
            el:'#app'
        })
    </script>
</body>
</html>